<?php

namespace Application\Sonata\UserBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\DependencyInjection\ContainerAware,
    Symfony\Component\HttpFoundation\RedirectResponse;
use Application\Sonata\UserBundle\Entity\User;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class UtilisateurController extends Controller {

    public function indexAction() {
        $em = $this->getDoctrine()->getEntityManager();
        $repository=$em->getRepository('ApplicationSonataUserBundle:User');
        $utlisateurs=$repository->findAll();
        return $this->render('ApplicationSonataUserBundle::Utilisateur.html.twig',array('users'=>$utlisateurs));
    }

}